<?php
//  __call() is triggered when invoking inaccessible methods in an object context.

//  __callStatic() is triggered when invoking inaccessible methods in a static context.

class MethodTest
{
  public function __call($name, $arguments)
  {
    echo "Calling object method '$name' is not exists\n\n";
  }


  public static function __callStatic($name, $arguments)
  {
    echo ">>>>>>>>>",__METHOD__,"<<<<<<<<<<<<";

    // Note: value of $name is case sensitive.
    echo "Calling static method '$name' "
       . implode(', ', $arguments). "<br>";
  }

  function hello()
  {
    return "\n\nhello world\n\n";
  }
}

$obj = new MethodTest;
$obj->runTest('in object context');
echo $obj->hello();

MethodTest::runTest('in static context');









